package com.zx.entity;/**
 * Author:JasonZ
 * Data:2023/4/17
 */

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * @program: ecommerce-parent
 * @description:
 * @author: JasonZ
 * @create: 2023-04-17 09:50
 **/
// JPA ORM----》 entity--映射-->table

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity  // 代表该类是一个实体类---》需要和表格进行映射
@Table(name="t_ecommerce_user")
// 启用审计监听器
@EntityListeners(AuditingEntityListener.class)
public class ECommerceUser {
    @Id
    // 描述主键生成策略
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String username;
    private String password;
    @Column(name="extra_info")
    private String extraInfo;
    @CreatedDate    // 自动日期审计
    private Date createTime;
    @LastModifiedDate
    private Date updateTime;
//    ResultMap
}
